using Web.Model;

namespace Web.DataAccess.Mappings
{
	public class ProjectMapping : EntityMapping<Project>
	{
		public ProjectMapping()
		{
			Map(x => x.Beginning);
			Map(x => x.ShortDescription);
			Map(x => x.Description);
			Map(x => x.Ending);
			Map(x => x.Name);
            Map(x => x.IsHidden);
			Map(x => x.CompletionApproval);
			References(x => x.Organizer);
		    HasMany(x => x.Vacancies).Cascade.SaveUpdate();
		    HasMany(x => x.Photos).Cascade.SaveUpdate();
			References(x => x.ProjectAvatar).Cascade.SaveUpdate();
		}
	}
}